package cn.sciento.core.async;

import java.util.Map;

public interface AsyncTemplate<T extends TaskDTO> {
    default String submit(T dto, Executor executor) {
        String uuid = executor.execute();
        afterSubmit(dto);
        return uuid;
    }

    void afterSubmit(T paramT);

    Object doWhenFinish(T paramT, Map<String, Object> paramMap);

    Object doWhenOccurException(T paramT, Throwable paramThrowable);
}
